package com.wyan.wiki.req;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

public class CategorySaveReq {

        private Long id;

        private Long parent;

        @NotBlank(message = "【名称】不能为空")
        private String name;

        @NotNull(message = "【排列】不能为空")
        private Integer sort;

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public Long getParent() {
            return parent;
        }

        public void setParent(Long parent) {
            this.parent = parent;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getSort() {
            return sort;
        }

        public void setSort(Integer sort) {
            this.sort = sort;
        }

        @Override
        public String toString() {
            StringBuilder sb = new StringBuilder();
            sb.append(getClass().getSimpleName());
            sb.append(" [");
            sb.append("Hash = ").append(hashCode());
            sb.append(", id=").append(id);
            sb.append(", parent=").append(parent);
            sb.append(", name=").append(name);
            sb.append(", sort=").append(sort);
            sb.append("]");
            return sb.toString();
        }
    }